package cn.yh.register.task;

import cn.yh.register.common.constant.MqConst;
import cn.yh.register.common.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 有点儿意思
 * @Description:
 */
@Component
@EnableScheduling
public class ScheduledTask {


    @Autowired
    private RabbitService rabbitService;

    /**
     * 给订单服务定时让订单服务给短信服务提供信息消费
     * 让短信服务给用户发信息
     */
    @Scheduled(cron = "0/30 * * * * ?")
    public void task1(){
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_8,"");
    }
}
